<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- 加载 React-->
    <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
    <!-- 引入 babel-->
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
    <title>React</title>
</head>
<body>
<div id="app"></div>
<script type="text/babel">

    class Hello extends React.Component {
        render() {
            return (
                // 接受属性
                <h1>Hello, {this.props.name}！</h1>
            );
        }
    }

    class App extends React.Component {
        render() {
            return (
                // <div>hello!!!!</div>
                <div>
                    // 传递属性
                    <Hello name="Harry"/>
                    <Hello name="Ron"/>
                    <Hello name="Hermione"/>
                </div>
            );
        }
    }

    ReactDOM.render(<App/>, document.querySelector('#app'));

</script>
</body>
</html>